    <?php
        foreach ($aTasks AS $k => $v)
        {
    ?>
            <tr>
                <td>
                    <?php
                        if (isset($v['table'])) // we have a tablename and indexname
                        {
                            $name = '['.$v['table'].']';
                            $label = $v['table'];

                            $label.= '.'.$v['name'];
                            $value = $v['name'];
                        }
                        else // we have a tablename and perhaps a fieldname
                        {
                            $name = '['.$v['name'].']';
                            $label = $v['name'];
                            if (isset($v['field']))
                            {
                                $label.= '.'.$v['field'];
                                $value = $v['field'];
                            }
                            else
                            {
                                $value = 1;
                            }
                        }
                        echo $label;
                        if ($showCargo)
                        {
                            echo '<br />';
                            foreach ($v['cargo']['change'][$v['field']]['definition'] AS $dk => $dv)
                            {
                                echo $dk.' = '.$dv.'<br />';
                            }
                        }
                    ?>
                </td>
                <td><input type="checkbox" name="<?php echo $fieldname.$name ?>" value="<?php echo $value; ?>" <?php if ($tickAll) { echo 'checked';} ?>/></td>
            </tr>

    <?php
        }
    ?>
